package org.jeecg.common.exception;

import org.jeecg.common.enums.ResultCodeEnums;

/**
 * @author by sean
 * @desc: 处理之定义返回值的异常
 * @since 2024-06-27 星期四 13:16:51
 */
public class JeecgBootResultException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer code;


    public JeecgBootResultException(ResultCodeEnums resultCodeEnums){
        super(resultCodeEnums.getMessage());
        this.code = resultCodeEnums.getCode();
    }

    public JeecgBootResultException(Integer code, String message){
        super(message);
        this.code = code;
    }

    public JeecgBootResultException(Throwable cause)
    {
        super(cause);
    }

    public JeecgBootResultException(String message, Throwable cause)
    {
        super(message,cause);
    }

    public Integer getCode() {
        return code;
    }
}
